package com.finance.system.request;

import com.finance.base.constant.PatternConstants;
import com.finance.framework.lang.valid.DateValid;
import com.finance.framework.lang.valid.EnumValid;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;


/**
 * 用户入参form
 * Created by CBWL on 2017/3/15.
 */
@Data
public class UserReq {
    private String id;//唯一标识
    @NotBlank(message="用户编码不可为空")
    @Length(min=2, max=20,message = "用户编码长度介于2-20")
    private String code;//用户编码
    @Pattern(regexp = PatternConstants.PATTERN_NUMBER_ONE_OR_TWO,message = "激活状态只能是0或1")
    private String state;//激活状态
    @Length(min=15, max=18,message = "身份证号长度介于15-18")
    private String idCard;//身份证号
    @Pattern(regexp = PatternConstants.PATTERN_NUMBER,message = "手机号必须为数字")
    private String mobile;//手机号码
    @DateValid(message = "入职日期格式不对")
    private String hireDate;//入职日期
    @DateValid(message = "离职日期格式不对")
    private String leaveDate;//离职日期
    @EnumValid(enums = {"0","1","2","3"},message = "计算类型举型")
    private String settlementType;//结算类型
    @Length(min=2, max=20,message = "工号长度介于2-20")
    private String workNo;//工号

    private String passwd;//密码
    private String realName;//真实姓名
    private String onJob;//在职状态
    private String orgCode;//所在机构编码
    private String roleId;//角色id
}
